<?php

/**
 * FWmessanger
 *
 */
class FWmessanger
{
    protected static $instance = null;
    
     /**
     *  Instance our Registry
     * @return FWregistry::$instance;
     */

    public static function getInstance()
    {
        if(self::$instance === null)
        {
            self::$instance = new FWmessanger();
        }
        return self::$instance;
    }

    /**
     * no custom registries
     * no anarchy
     */
    private function __clone() {}
    protected function __construct() {}


    /**
     * send a message to registry
     * @param int $lvl
     * @param string $msg
     */
    function send($lvl, $msg)
    {
        $r = FWregistry::getInstance();
        $r->sset(
                microtime(),
                array( "level" => $lvl, "msg" => $msg, "fwd" => false ),
                "msg"
            );
    }
}

?>
